package com.sc.nft.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

/**
 * 售后状态
 * 仅退款：申请中 -> 退款中 -> 已退款or已拒绝
 * 退货退款：申请中 -> 待退货or已拒绝 -> 退货中 -> 退款中 ->已退款
 * 换货：申请中 -> 待退货or已拒绝 -> 退货中 -> 换货中 -> 换货待收 -> 换货完成
 *
 * @author liGen
 * @version 1.0
 * @date 2023/11/20 3:09 下午
 */
@AllArgsConstructor
@Getter
public enum MallRefundStatusEnum {

    APPLYING(1, "申请中","您已成功发起售后申请，请耐心等待商家处理。\n" +
            "商家同意后，如需退货请按照给出的退货地址退货，记录并填写退货信息。若无需\n" +
            "退货，将为您退款。\n" +
            "如商家拒绝，您可以联系商家或申请平台介入协调。\n" +
            "如商家超时未处理，申请将自动同意，如需退货请按系统给出的退货地址退货。"),
    REFUSE_REFUND(2, "已拒绝","商家已拒绝您的售后申请，您可以在3天内联系商家处理"),
    REFUNDING(3, "待退款","系统将在1-3个工作日内退款至您的原支付账户"),
    REFUND_SUCCES(4, "已退款","已退款至您的原支付账户，请注意查收"),
    CANCEL(5, "取消售后","未在规定时间内处理售后/主动取消，已取消售后。"),
    TO_BE_RETURNED(6, "待退货","请按照给出的退货地址退货，记录并填写退货信息。"),
    RETURNING_GOODS(7, "退货中","已退回商品，等待商家收货确认。"),
    EXCHANGING_GOODS(8, "换货中","商家收到退货，换货进行中~"),
    REPLACEMENT_TO_BE_RECEIVED(9, "换货待收","商家已寄出换货商品，请注意查收。"),
    REPLACEMENT_COMPLETED(10, "换货完成","您已完成换货。"),

    ;
    @EnumValue
    private int code;
    private String description;
    private String remark;

    /**
     * 有效金额售后单
     *
     * @return
     */
    public static List<MallRefundStatusEnum> getAmountInForceStatusList() {
        List<MallRefundStatusEnum> list = Lists.newArrayList();
        list.add(APPLYING);
        list.add(REFUNDING);
        list.add(REFUND_SUCCES);
        list.add(TO_BE_RETURNED);
        list.add(RETURNING_GOODS);
        list.add(EXCHANGING_GOODS);
        list.add(REPLACEMENT_TO_BE_RECEIVED);
        list.add(REPLACEMENT_COMPLETED);
        return list;
    }

    /**
     * 可以取消售后状态
     *
     * @return
     */
    public static List<MallRefundStatusEnum> cancelStatusList() {
        List<MallRefundStatusEnum> list = Lists.newArrayList();
        list.add(APPLYING);
        list.add(TO_BE_RETURNED);
        return list;
    }

    /**
     * 售后中状态
     *
     * @return
     */
    public static List<MallRefundStatusEnum>  afterSalesStatusList() {
        List<MallRefundStatusEnum> list = Lists.newArrayList();
        list.add(APPLYING);
        list.add(REFUNDING);
        list.add(TO_BE_RETURNED);
        list.add(RETURNING_GOODS);
        list.add(EXCHANGING_GOODS);
        list.add(REPLACEMENT_TO_BE_RECEIVED);
        return list;
    }
}
